home *** CD-ROM | disk | FTP | other *** search
- property ancestor
- global baseRecordSprOffset, clipDataField, backgroundSpr, currentFrame, dispatchTable, bgdData, theStageBounds, curClipRecord, dirtyFlag
-
- on birth me
- set the ancestor of me to birth(script "recordMethods parent")
- return me
- end
-
- on record me
- set slotNum to 1
- set nukeSlots to []
- set partsList to value(line 1 of field "partsListData")
- repeat with theSlot in dispatchTable
- if getAt(theSlot, 1) = "S" then
- set searchString to getAt(theSlot, 2)
- set found to 0
- repeat with propNameList in partsList
- repeat with propName in propNameList
- if propName = searchString then
- append(nukeSlots, slotNum)
- set found to 1
- exit repeat
- end if
- end repeat
- if found then
- exit repeat
- end if
- end repeat
- end if
- set slotNum to slotNum + 1
- end repeat
- if count(bgdData) < currentFrame then
- set previousBackgroundCast to getLast(bgdData)
- else
- set previousBackgroundCast to getAt(bgdData, currentFrame)
- end if
- set backgroundCastNumber to getAt(curClipRecord, 4)
- set the castNum of sprite backgroundSpr to backgroundCastNumber
- cursor(-1)
- set theMaxV to 316
- set theMinV to 121
- repeat while the mouseUp
- set theMouseLoc to point(the mouseH, the mouseV)
- if inside(theMouseLoc, theStageBounds) then
- repeat with theSlot in nukeSlots
- set the loc of sprite (theSlot + baseRecordSprOffset) to point(-1000, 0)
- end repeat
- set the castNum of sprite backgroundSpr to backgroundCastNumber
- if (the mouseV >= theMinV) and (the mouseV <= theMaxV) then
- set the locV of sprite backgroundSpr to the mouseV
- else
- if the mouseV < theMinV then
- set the locV of sprite backgroundSpr to theMinV
- else
- if the mouseV > theMaxV then
- set the locV of sprite backgroundSpr to theMaxV
- end if
- end if
- end if
- else
- showFrame(playbackMgr, currentFrame, 0)
- end if
- updateStage()
- end repeat
- set theMouseLoc to point(the mouseH, the mouseV)
- if inside(theMouseLoc, theStageBounds) then
- set nukeChannels to []
- repeat with theSlot in nukeSlots
- append(nukeChannels, getAt(getAt(dispatchTable, theSlot), 3))
- end repeat
- repeat with theChannel in nukeChannels
- deletePropPart(editMgr, theChannel)
- end repeat
- set theBackgroundSprV to the locV of sprite backgroundSpr
- set currentBgdData to list(backgroundCastNumber, 313, theBackgroundSprV)
- set countBgdData to count(bgdData)
- set firstTimeFlag to 0
- if (countBgdData = 1) and (getAt(bgdData, 1) = [5051, 313, 243]) then
- set firstTimeFlag to 1
- repeat with theFrameNumber = 1 to count(scoreData)
- setAt(bgdData, theFrameNumber, currentBgdData)
- end repeat
- else
- if countBgdData < currentFrame then
- repeat with theFrameNumber = countBgdData + 1 to currentFrame - 1
- setAt(bgdData, theFrameNumber, previousBackgroundCast)
- end repeat
- repeat with theFrameNumber = currentFrame to count(scoreData)
- setAt(bgdData, theFrameNumber, currentBgdData)
- end repeat
- else
- repeat with theFrameNumber = currentFrame to count(scoreData)
- setAt(bgdData, theFrameNumber, currentBgdData)
- end repeat
- end if
- end if
- showFrame(playbackMgr, currentFrame, 0)
- set dirtyFlag to 1
- updateTheBrain(appMgr)
- else
- unLoadCast(backgroundCastNumber)
- showFrame(playbackMgr, currentFrame, 0)
- end if
- end
-
- on addPropsToBackground me, backgroundName, firstTimeFlag
- set partsList to value(line 1 of field "partsListData")
- set propNameList to getaProp(partsList, value("#" & backgroundName))
- if not voidp(propNameList) then
- repeat with propName in propNameList
- repeat with lineNumber = 1 to the number of lines in field "ppcData"
- if value(item 2 of line lineNumber of field "ppcData") = propName then
- set curClipRecord to value(line lineNumber of field "ppcData")
- exit repeat
- end if
- end repeat
- set layerOverflow to 0
- set theType to getAt(curClipRecord, 1)
- set theGroup to getAt(curClipRecord, 2)
- set theOffsets to getAt(curClipRecord, 3)
- set hOffset to getAt(theOffsets, 1)
- set vOffset to getAt(theOffsets, 2)
- if isEmptyP(layerMgr) then
- set curDataChannel to addNewSlot(layerMgr, theType, theGroup, clipDataField)
- else
- set curDataChannel to findDuplicateCategory(layerMgr, theGroup)
- if curDataChannel = 0 then
- set recordingDuplicateClip to 0
- if isFullP(layerMgr) then
- set layerOverflow to 1
- else
- set curDataChannel to addNewSlot(layerMgr, theType, theGroup, clipDataField)
- if (theType = "S") or (theType = "P") then
- insertProp(layerMgr, theType, theGroup)
- end if
- end if
- end if
- end if
- if not layerOverflow then
- set theLayer to getLayer(layerMgr, theGroup)
- set theRecordingLayer to theLayer + baseRecordSprOffset
- setupClipData(me)
- update(stackMgr)
- set propH to the locH of sprite backgroundSpr + hOffset
- set propV to the locV of sprite backgroundSpr + vOffset
- set frameData to list(firstClip, propH, propV)
- set oldCurrentFrame to currentFrame
- if firstTimeFlag then
- set currentFrame to 1
- end if
- repeat with theFrameNumber = currentFrame to count(scoreData)
- addFrame(listMgr, frameData, curDataChannel)
- incrementFrame()
- end repeat
- set currentFrame to oldCurrentFrame
- end if
- end repeat
- end if
- end
-